Public Class SecurityForm

  Private Sub LoadReadSecureStringButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LoadReadSecureStringButton.Click

    If InputTextBox.Text.Length > 0 Then

      Dim ss As System.Security.SecureString = dotNetTips.Utility.Security.SecurityHelper.LoadSecureString(InputTextBox.Text, True)

      MessageBox.Show(dotNetTips.Utility.Security.SecurityHelper.ReadSecureString(ss))

    End If


  End Sub

  Private Sub CompareSecureStringsButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CompareSecureStringsButton.Click


    If InputTextBox.Text.Length > 0 Then

      Dim ss1 As System.Security.SecureString = dotNetTips.Utility.Security.SecurityHelper.LoadSecureString(InputTextBox.Text, True)

      Dim ss2 As System.Security.SecureString = dotNetTips.Utility.Security.SecurityHelper.LoadSecureString(InputBox("Type String to Compare"), True)

      MessageBox.Show(dotNetTips.Utility.Security.SecurityHelper.CompareSecureStrings(ss1, ss2).ToString)

    End If


  End Sub
End Class